package org.zsl.mybatis.app;

import org.apache.ibatis.session.SqlSession;
import org.zsl.mybatis.mapper.UserMapper2;
import org.zsl.mybatis.model.User;
import org.zsl.mybatis.util.SqlSessionFactory;

import java.io.IOException;
import java.util.List;

public class Client9 {

    public static void main(String[] args) throws IOException {

        SqlSession session = SqlSessionFactory.getSqlSession2();

       UserMapper2 mapper2=   session.getMapper(UserMapper2.class);

        User user = new User();

//        user.setUsername("ad");
        user.setPassword("123");

        List<User> userList= mapper2.selectByExample(user);

        for (User usr:userList) {
            System.out.println(usr);
        }

        session.close();
    }
}
